<?php
// Global utility functions.

// Checks if current session is logged in, and if not redirects to login page.
function check_login() {
	if((!$_SESSION['id']) or ($_SESSION['id'] == "")) {
		Header('Location: ./login.php');
		exit();
	}
}

// Formats an error message.
function errmsg($error_string) {
	$error = "<p class=\"errmsg\">Error: ";
	$error .= $error_string;
	$error .= "</p>";
	return $error;
}

?>
